<template>
  <el-select v-model="value" filterable placeholder="请选择机构" @change="changeValue($event)" clearable style="width:100%">
    <el-option
      v-for="item in partyGroup"
      :key="item.code"
      :label="item.groupName"
      :value="item.code"
    />
  </el-select>
</template>
<script>
import request from '@/utils/request'
export default {
  data() {
    return {
      value: '',
      partyGroup: [],
      callbackMethod: ''
    }
  },
  // created() {
  //   this.getPartyGroup()
  // },
  methods: {
    // getPartyGroup() {
    //   request({
    //     url: '/arpa-basic-api/partyGroup/listNotLevel',
    //     method: 'get'
    //   }).then(response => {
    //     this.partyGroup = response.data
    //   })
    // },
    changeValue(e) {
      this.$emit(this.callbackMethod, this.value)
    },
    setSelectValue(value) {
      this.value = value
    },
    initData(partyGroup, callbackMethod) {
      this.partyGroup = partyGroup
      this.callbackMethod = callbackMethod
    }
  }
}
</script>
